<?php if(!IS_AJAX){?>
<include file="Public:header" />
<style>
.expend-calendar{padding-left: 85px;padding-right: 10px;position: relative;}
.widget-calendar{width: 85px;padding: 0 10px;position: absolute;}
.widget-calendar .date{width: 60px;height: 60px;border-radius: 4px;box-shadow: 0 1px 4px rgba(0,0,0,0.14); margin:auto;}
.widget-calendar .month{background: linear-gradient(to bottom,#abf6da ,#78dcb6);color: #fff;}
.widget-calendar .day{ color:#999;}
.panel-log{}
.panel-log .social-links{ margin-top:5px; background: white;position: absolute;right: 10px; top:-10px; padding-right:5px;}
.panel-log .DataListItem:not(:last-child){ border-bottom:1px solid #ddd; padding-bottom:5px;}
.panel-log .DataListItem:not(:first-child){ margin-top:20px;}
.panel-log .title{ white-space:nowrap; padding-right:75px; overflow:hidden; text-overflow:ellipsis; margin-bottom:15px;}
.panel-log .content{ padding-top:10px; height:48px; overflow:hidden; border-top:1px solid #f3f3f3;}
</style>
<div class="row">
    <div class="col-sm-7 col-md-8 col-lg-9">
        <div class="panel directory-info-row" style="margin-top:0;">
            <div class="panel-heading">
                <span class="pagetitle">公告列表</span>
            </div>
            <div class="panel-body panel-log">
                <div class="" id="ajaxlistbox">
                    <?php }?>
                    <?php if(IS_AJAX){?>
                    <!-- 数据主体 -->
                    <volist name="list" id="vo">
                        <div class="DataListItem DataListItembg row" id="ajaxlistbox-{$vo.id}">
                            <div class="BatchOperation BatchOperationBtn">
                                <input class="checkbox" type="checkbox" name="id[]" value="{$vo.id}">
                                <i class="fa icon-check"></i>
                                <div class="fabg">
                                </div>
                            </div>
                            <div class="widget-calendar text-center">
                                <div class="date">
                                    <div class="month">
                                        {:date('m',$vo['datetime'])}月
                                    </div>
                                    <h4 class="day">
                                        {:date('d',$vo['datetime'])}
                                    </h4>
                                </div>
                                <h6>周{:date('w',$vo['datetime'])}</h6>
                            </div>
                            <div class="expend-calendar">
                                <div class="widget-content padded">
                                    <h5>
                                        <div class="title"><b>{$vo.title}</b></div> 
                                        <ul class="optionBtnBox social-links pull-right">
                                            <li>
                                                
                                                <if condition="getAccessMenu($accessList, 'Intesys', 'Info_notice', 'update') && $vo['member_id']==$UserInfo">
                                                    <a title="修改公告" data-placement="top" data-toggle="tooltip" class="tooltips OptionBtn" width="650" href="javascript:void(0);" rel="{:U('edit', array('id' => $vo['id']))}" data-original-title="修改公告" <eq name="key" value="0">data-position="top" data-intro="编辑公告"</eq>>
                                                        <i class="fa icon-edit"></i>
                                                    </a>
                                                </if>
                                                <if condition="getAccessMenu($accessList, 'Intesys', 'Info_notice', 'delete') && $vo['member_id']==$UserInfo">
                                                    <a title="删除" data-placement="top" data-toggle="tooltip" class="tooltips deleteBtn" href="javascript:void(0);" rel="{:U('delete', array('id' => $vo['id']))}" data-id="{$vo.id}" data-original-title="删除" <eq name="key" value="0">data-position="top" data-intro="删除公告"</eq>>
                                                        <i class="fa icon-trash-o"></i>
                                                    </a>
                                                </if>
                                            </li>
                                        </ul>
                                           <!--手机版本的操作按钮组-->
                                      <div  class="BottomOptionBtn hidden"> <a class="button" href="#window" onClick="_openWindow('{:U('edit', array('id' => $vo['id']))}', 650, '修改公告', '保存', null, '');"> <span class="fa icon-edit"></span> 编辑 </a> 
                                    
                                      <a class="button BottomdeleteBtn" removeElement=".CustomerList .item{$vo.id}" href="javascript:void(0);" rel="{:U('delete', array('id' => $vo['id']))}"> <span class="fa icon-trash"></span>删除 </a>>
                                      
                                    </div>
                                    </h5>
                                    <p class="content">内容：{$vo.content}</p>
                                </div>
                            </div>
                        </div>
                        <!-- 数据主体结束 -->
                    </volist>	
                    <?php }?>
                    <?php if(!IS_AJAX){?>
                </div>
                <div class="PagesBox" id="ajaxlistboxpages">
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-5 col-md-4 col-lg-3">
        <div class="affixelement">
            <div class="states-info">
            	<if condition="getAccessMenu($accessList, 'Intesys', 'Info_notice', 'add')">
                    <div class="panel green-bg" id="ajaxlistboxaddbtn" title="写公告" rel="<?php echo(U('add')); ?>" width="650" style="cursor:pointer">
                        <div class="panel-body">
                            <div class="row">
                                <div class="col-xs-3">
                                    <i class="fa icon-bar-chart-o"></i>
                                </div>
                                <div class="col-xs-9">
                                    <h4>发布公告</h4>
                                    <span class="state-title"> 发布最新公告 </span>
                                </div>
                                <!--<div class="col-xs-2">
                                    <span class="fa icon-angle-right"></span>
                                </div>-->
                            </div>
                        </div>
                    </div>
                </if>
            </div>
            <div class="panel">
                <header class="panel-heading"> 公告搜索
                    <a href="##" id="ajaxlistboxbob" class="pull-right">
                        批量操作
                    </a>
                </header>
                <div class="panel-body">
                    <div class="form-group" id="ajaxlistboxboc" style="display:none;">
                        <a href="##" class="btn btn-info" id="ajaxlistboxsa">
                            全选
                        </a>
                        <a href="##" class="btn btn-info" id="ajaxlistboxca">
                            全不选
                        </a>
                        <a href="##" class="btn btn-info" id="ajaxlistboxsar">
                            反选
                        </a>
                        <a rel="<?php echo U('delete') ?>" href="##" class="btn btn-danger bdeleteBtn">
                            删除选中
                        </a>
                    </div>
                    <form action="<?php echo U('index');?>" id="ajaxlistboxform">
                        <div class="input-group m-bot15">
                            <input type="text" name="keywords" class="form-control" placeholder="请输入标题或内容的关键字">
                            <span class="input-group-btn">
                            <button type="button" onClick="$('#ajaxlistboxform').submit();" class="btn btn-default"><i class="fa icon-search" style="font-size:16px"></i></button>
                            </span>
                        </div>
                        <div id="infocategoryvar">
                        </div>
                    </form>
                </div>
            </div>
           
        </div>
    </div>
</div>
<include file="Public:script" />
<style>
    #infocategorybox td{padding:5px;}
	.btn-info{ margin-bottom:5px;}
</style>
<script>
$('#infocategorybox').ajaxlist({nodata:'<div style="text-align:center;">暂无分类</div>', success:function(obj){

	obj.find('.titletext').each(function(index, element){
		$(this).removeClass('titletext');
		$(this).click(function(e) {
            var html = '<div id="member_pos_id'+$(this).attr('data-id')+'" class="alert alert-info" style="display:inline-block; margin-bottom:2px; margin-right:2px; padding:5px;"><button type="button" class="close close-sm" onclick="" data-dismiss="alert"> <i class="fa icon-times"></i> </button><strong><input type="hidden" value="'+$(this).attr('data-id')+'" name="infocategory_id[]" class="NodeId" />'+$(this).html()+'</strong> </div>';
          $('#member_pos_id'+$(this).attr('data-id')).remove();
          $(html).appendTo('#infocategoryvar').find('.close').each(function(){
              $(this).click(function(e) {
                  setTimeout(function(){ $('#ajaxlistboxform').submit()}, 200);
              });
          });
          $('#ajaxlistboxform').submit();
        });
	});
}});
    $('#ajaxlistbox').ajaxlist({success:function(){
		$('.tooltips').tooltip();	console.log($('.tooltips').length);
	}});
</script>
</body></html><?php }?>